<!--
* description: 个人客户视图
* author: dxuem
* createdDate: 2019-10-23
-->
<template>
  <el-row style="background-color:white">
    <el-col :span="21">
      <div class="app-container app-container-table">

        <el-form class="editPer filter-params-crm-scroll crm-s-scroll edit" disabled>
          <div
            class="filter-container-crm filter-title-crm"
            id="custinfo-person"
          >{{infoComponents[0].title}}</div>
          <div class="filter-container-crm filter-params-crm">
            <crmGroupForm
              :dynamicComponentss="infoComponents[0].tableComponents"
              :values="formField"
            />
            <crmGroupForm
              :dynamicComponentss="infoComponents[0].tableComponents1"
              :values="formField"
            />
            <crmGroupForm
              :dynamicComponentss="infoComponents[0].tableComponents2"
              :values="formField"
            />
            <crmGroupForm
              :dynamicComponentss="infoComponents[1].tableComponents"
              :values="formField"
            />
          </div>
          <div
            class="filter-container-crm filter-title-crm"
            id="contactInfo"
          >{{infoComponents[2].title}}</div>
          <div class="filter-container-crm filter-params-crm">
            <crmGroupForm
              :dynamicComponentss="infoComponents[2].tableComponents"
              :values="formField"
            />
            <one-table-template
              ref="multipleTable"
              :dynamicButtons="infoComponents[3].tableButtons"
              :dynamicTableCols="infoComponents[3].tableCols"
              :dynamicIsShowSelect="false"
              :isShowPagination="true"
              :dynamicIsInitTable="true"
              :dynamicApiConfig="infoComponents[3].apiConfig"
              :dynamicFormFields="infoComponents[3].formField"
            />
          </div>
          <div
            class="filter-container-crm filter-title-crm"
            id="carrelation"
          >{{infoComponents[4].title}}</div>
          <div class="filter-container-crm filter-params-crm" style="margin-top:1px">
            <one-table-template
              ref="multipleTable"
              :dynamicButtons="infoComponents[4].tableButtons"
              :dynamicTableCols="infoComponents[4].tableCols"
              :dynamicIsShowSelect="false"
              :isShowPagination="true"
              :dynamicIsInitTable="true"
              :dynamicApiConfig="infoComponents[4].apiConfig"
              :dynamicFormFields="infoComponents[4].formField"
            />
          </div>
          <!-- <div
            class="filter-container-crm filter-title-crm"
            id="orderrecord"
          ><i class="el-icon-view"></i>{{infoComponents[5].title}}</div>
          <div class="filter-container-crm filter-params-crm">
            <one-table-template
              ref="multipleTable"
              :dynamicButtons="infoComponents[5].tableButtons"
              :dynamicTableCols="infoComponents[5].tableCols"
              :dynamicIsShowSelect="false"
              :isShowPagination="false"
              :dynamicIsInitTable="true"
              :dynamicApiConfig="infoComponents[5].apiConfig"
              :dynamicFormFields="infoComponents[5].formField"
            />
          </div> -->
          <div
            class="filter-container-crm filter-title-crm"
            id="getcustWay"
          >{{infoComponents[6].title}}</div>
          <div class="filter-container-crm filter-params-crm">
            <crmGroupForm
              :dynamicComponentss="infoComponents[6].tableComponents"
              :values="formField"
            />
          </div>
          <div
            class="filter-container-crm filter-title-crm"
            id="custPhoto"
          >{{infoComponents[7].title}}</div>
          <div class="filter-container-crm filter-params-crm">
            <crmGroupForm
              :dynamicComponentss="infoComponents[7].tableComponents"
              :values="formField"
            />
            <crmGroupForm
              :dynamicComponentss="infoComponents[8].tableComponents"
              :values="formField"
            />
            <crmGroupForm
              :dynamicComponentss="infoComponents[9].tableComponents"
              :values="formField"
            />
          </div>
          <!-- <div
            class="filter-container-crm filter-title-crm"
            id="Appointment"
          ><i class="el-icon-view"></i>{{infoComponents[10].title}}</div>
          <div class="filter-container-crm filter-params-crm">
            <one-table-template
              ref="multipleTable"
              :dynamicButtons="infoComponents[10].tableButtons"
              :dynamicTableCols="infoComponents[10].tableCols"
              :dynamicIsShowSelect="false"
              :isShowPagination="false"
              :dynamicIsInitTable="true"
              :dynamicApiConfig="infoComponents[10].apiConfig"
              :dynamicFormFields="infoComponents[10].formField"
            />
          </div> -->
          <!-- <div
            class="filter-container-crm filter-title-crm"
            id="custloyal"
          ><i class="el-icon-view"></i>{{infoComponents[11].title}}</div>
          <div class="filter-container-crm filter-params-crm">
            <crmGroupForm
              :dynamicComponentss="infoComponents[11].tableComponents"
              :values="formField"
            />
            <crmGroupForm
              :dynamicComponentss="infoComponents[12].tableComponents"
              :values="formField"
            />
          </div> -->
          <!-- <div
            class="filter-container-crm filter-title-crm"
            id="custPointrecord"
          ><i class="el-icon-view"></i>{{infoComponents[13].title}}</div>
          <div class="filter-container-crm filter-params-crm">
            <one-table-template
              ref="multipleTable"
              :dynamicButtons="infoComponents[13].tableButtons"
              :dynamicTableCols="infoComponents[13].tableCols"
              :dynamicIsShowSelect="false"
              :isShowPagination="false"
              :dynamicIsInitTable="true"
              :dynamicApiConfig="infoComponents[13].apiConfig"
              :dynamicFormFields="infoComponents[13].formField"
            />
          </div> -->
          <div
            class="filter-container-crm filter-title-crm"
            id="custdatalog"
          >{{infoComponents[14].title}}</div>
          <div class="filter-container-crm filter-params-crm">
            <one-table-template
              ref="multipleTable"
              :dynamicButtons="infoComponents[14].tableButtons"
              :dynamicTableCols="infoComponents[14].tableCols"
              :dynamicIsShowSelect="false"
              :isShowPagination="false"
              :dynamicIsInitTable="true"
              :dynamicApiConfig="infoComponents[14].apiConfig"
              :dynamicFormFields="infoComponents[14].formField"
            />
          </div>
        </el-form>
      </div>
    </el-col>
    <el-col :span="3">
      <anchor :idparams="idparams"></anchor>
    </el-col>
  </el-row>
</template>
<script>
import anchor from "@/components/crm/PositionAnchor";
import { formMixins } from "@/components/mixins/formMixins";
import { crmApis } from "@/api/apiList/crm";
import { requestAPI } from "@/api/commonRequest";
import crmGroupForm from "@/components/crm/commonComponents/crmGroupForm";
import crmGroupSubmit from "@/components/crm/commonComponents/crmGroupSubmit";
import OneTableTemplate from "@/components/crm/Template/crmformonePage";
export default {
  name: "PerInfo",
  // 组件混入对象
  mixins: [formMixins],
  components: {
    crmGroupForm,
    crmGroupSubmit,
    OneTableTemplate,
    anchor
  },
  props: {},
  data() {
    return {
      idparams: [
        { id: "custinfo-person", name: "客户信息-个人",index:0 },
        { id: "contactInfo", name: "联系信息",index:1 },
        { id: "carrelation", name: "车辆关系",index:2 },
        // { id: "orderrecord", name: "订单记录",index:3 },
        { id: "getcustWay", name: "获客渠道",index:3 },
        { id: "custPhoto", name: "客户画像",index:4 },
        // { id: "Appointment", name: "预约记录",index:6 },
        // { id: "custloyal", name: "客户忠诚度",index:7 },
        // { id: "custPointrecord", name: "客户触点记录",index:8 },
        { id: "custdatalog", name: "客户资料修改日志",index:5 }
      ], //用于锚点
      keyInfo: false,
      ismore: false,
      ismutiple: false,
      action: "", //证件上传地址
      accepttype:
        ".jpg,.jpeg,.png,.gif,.bmp,.pdf,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF", //上传文件类型
      text1: "选择文件",
      limit: 1,
      showedit: false,
      params: {},
      nagflag: true,
      posflag: false,
      flag: true,
      editPopupsKey: "",
      editPopupsState: "",
      editPopupsVisible: false,
      infoComponents: [
        // 客户信息  0
        {
          title: "客户信息-个人",
          tableComponents: [
            {
              compKey: "compKey1",
              labelName: "UID",
              codeField: "uid",
              code: "",
              isMust: true,
              disabled: true,
              readonly:true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey2",
              labelName: "客户名称",
              codeField: "custName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey3",
              labelName: "性别",
              disabled: true,
              codeField: "genderName",
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey4",
              labelName: "出生日期",
              disabled: true,
              codeField: "birthDate",
              isMust: true,
              inputType: "2",
              component: () => import("@/components/crm/Time/crmdatePicker")
            },
            // {
            //   compKey: "compKey5",
            //   labelName: "民族",
            //   disabled: true,
            //   codeField: "nationCodeName",
            //   isMust: true,
            //   component: () => import("@/components/crm/textbox/crmTextInput")
            // },
            {
              compKey: "compKey5",
              labelName: "民族",
              codeField: "nationCode",
              isRequire: false,
              isMust: true,
              isMul: false,
              lookuptype: "DB0026",
              component: () =>
                import("@/components/crm/lookupValue/lookupvalue")
            },
            {
              compKey: "compKey6",
              labelName: "证件类型",
              codeField: "credTypeCode",
              lookuptype: "DB0037",
              isRequire: false,
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/lookupValue/lookupvalue")
            },
            {
              compKey: "compKey7",
              labelName: "证件号码",
              codeField: "credNo",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput"),
              span:12
            },
            // {},

          ],
          tableComponents1:[
            {
              compKey: "compKey8",
              labelName: "信息来源",
              codeField: "infoChanName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput"),
              span:12
            },
            {
              compKey: "compKey11",
              labelName: "客户来源",
              codeField: "custOriginCode",
              lookuptype: "LX860",
              isRequire: false,
              disabled:true,
              isMust: true,
              component: () =>
                import("@/components/crm/lookupValue/lookupvalue")
            },
            {
              compKey: "compKey9",
              labelName: "建档日期",
              codeField: "createdDate",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput"),
              span:6
            },

          ],
          tableComponents2:[
            {
              compKey: "compKey10",
              labelName: "省份",
              codeField: "provinceId",
              textField: "provinceName",
              disabled: true,
              isRequire: false,
              isMust: true,
              isMul: false,
              lookuptype: crmApis.mdmOrgProvinceQueryFindAll,
              changeCode: this.changeCityByProvince,
              component: () => import("@/components/crm/lookupValue/singleDropList"),
              span:6
            },
            {
              compKey: "provinceId",
              labelName: "城市",
              codeField: "cityId",
              textField: "cityName",
              isRequire: false,
              disabled: true,
              isMust: true,
              isMul: false,
              lookuptype: crmApis.mdmOrgCityQueryFindAll,
              changeCodeArray: [{ changCode: "provinceId" }],
              component: () => import("@/components/crm/lookupValue/secondDropList")
            },
            {
              compKey: "cityId",
              labelName: "区县",
              codeField: "countyId",
              textField: "countyName",
              disabled: true,
              isRequire: false,
              isMust: true,
              isMul: false,
              lookuptype: crmApis.mdmOrgCommunityQueryFindAll,
              changeCodeArray: [{ changCode: "cityId" }],
              component: () => import("@/components/crm/lookupValue/secondDropList")
            },
            {
              compKey: "compKey13",
              labelName: "详细地址",
              codeField: "addrStreet",
              disabled: true,
              isMust: true,
              span: 12,
              component: () => import("@/components/crm/textbox/crmTextInput")
            }
          ]
        },
        // 1
        {
          title: "",
          tableComponents: [
            {
              compKey: "compKey14",
              labelName: "身份证1",
              codeField: "idCardPath",
              isMust: true,
              fileList: [],
              getVal:[],
              submitBtn: false,
              disabled:true,
              action: "/mp/file/crm/upload.do",
              limit:1,
              accepttype:'.jpg,.png',
              isautoupload: true,
              component: () => import("@/components/crm/crmEjectWindows/crmImgUpload/index"),//src\components\crm\crmEjectWindows\crmImgUpload\index.vue
              // emitCode:this.getUploadFiles1,

            },
            {
              compKey: "compKey15",
              labelName: "身份证2",
              codeField: "driveCardPath",
              submitBtn: false,
              isMust: true,
              fileList: [],
              getVal:[],
              disabled:true,
              action: "/mp/file/crm/upload.do",
              limit:1,
              accepttype:'.jpg,.png',
              isautoupload: true,
              component: () => import("@/components/crm/crmEjectWindows/crmImgUpload/index"),
              // emitCode:this.getUploadFiles2,

            },
            {
              compKey: "compKey16",
              labelName: "行驶证",
              codeField: "drivingCardPath",
              isMust: true,
              submitBtn: false,
              fileList: [],
              getVal:[],
              limit:1,
              disabled:true,
              accepttype:'.jpg,.png',
              action: "/mp/file/crm/upload.do",
              isautoupload: true,
              isUpload: true,
              component: () => import("@/components/crm/crmEjectWindows/crmImgUpload/index"),
              // emitCode:this.getUploadFiles3,
            },
            // {
            //   compKey: "compKey14",
            //   labelName: "身份证",
            //   codeField: "idCardPath",
            //   isMust: true,
            //   getVal: "",
            //   component: () => import("@/views/crm/cu/CustInfo/img")
            // },
            // {
            //   compKey: "compKey15",
            //   labelName: "驾驶证",
            //   codeField: "driveCardPath",
            //   isMust: true,
            //   getVal: "",
            //   component: () => import("@/views/crm/cu/CustInfo/img")
            // },
            // {
            //   compKey: "compKey16",
            //   labelName: "行驶证",
            //   codeField: "drivingCardPath",
            //   isMust: true,
            //   getVal: "",
            //   component: () => import("@/views/crm/cu/CustInfo/img")
            // }
          ]
        },
        // 联系信息  2
        {
          title: "联系信息",
          tableComponents: [
            {
              compKey: "compKey18",
              labelName: "电话",
              codeField: "phone",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey19",
              labelName: "备用电话",
              codeField: "backupPhone",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey20",
              labelName: "家庭电话",
              codeField: "homeTel",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey21",
              labelName: "办公电话",
              codeField: "officeTel",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey22",
              labelName: "QQ号",
              codeField: "qq",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey23",
              labelName: "微信号",
              codeField: "openId",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey24",
              labelName: "邮政编码",
              codeField: "addrZip",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey24",
              labelName: "电子邮箱",
              codeField: "email",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            // {
            //   compKey: "compKey27",
            //   labelName: "方便联系场所",
            //   codeField: "convLocaleName",
            //   disabled: true,
            //   component: () => import("@/components/crm/textbox/crmTextInput")
            // },
            // {
            //   compKey: "compKey28",
            //   labelName: "方便联系时段",
            //   codeField: "convTimeName",
            //   disabled: true,
            //   component: () => import("@/components/crm/textbox/crmTextInput")
            // },
            // {
            //   compKey: "compKey29",
            //   labelName: "首选联系方式",
            //   codeField: "contactTypeName",
            //   disabled: true,
            //   component: () => import("@/components/crm/textbox/crmTextInput")
            // }
            {
              compKey: "compKey28",
              labelName: "方便联系时段",
              codeField: "convTimeCode",
              isMul: false,
              lookuptype: "DB0030",
              disabled: true,
              component: () =>
                import("@/components/crm/lookupValue/lookupvalue")
            },
            {
              compKey: "compKey29",
              labelName: "首选联系方式",
              codeField: "contactTypeCode",
              isMul: false,
              lookuptype: "DB0029",
              disabled: true,
              component: () =>
                import("@/components/crm/lookupValue/lookupvalue")
            }
          ]
        },
        // 3
        {
          apiConfig: crmApis.custViewCustRelationQueryFindAll, //客户信息明细-联系人列表
          formField: {
            dlrCustNo: this.$route.params.dlrCustNo
          },
          tableCols: [
            {
              prop: "relationTypeName",
              label: "类别",
              width: null,
              align: "center"
            },
            {
              prop: "custRelationName",
              label: "关系描述",
              width: null,
              align: "center"
            },
            {
              prop: "custName",
              label: "姓名",
              width: null,
              align: "center"
            },
            {
              prop: "genderName",
              label: "性别",
              width: null,
              align: "center"
            },
            {
              prop: "phone",
              label: "联系电话",
              width: null,
              align: "center"
            },
            {
              prop: "addr",
              label: "地址",
              width: null,
              align: "center"
            }
          ]
        },
        // 车辆关系  4
        {
          title: "车辆关系",
          apiConfig: crmApis.custViewCustCarListQueryFindAll, //客户信息明细-车辆关系
          formField: {
            dlrCustNo: this.$route.params.dlrCustNo
          },
          tableCols: [
            {
              prop: "vin",
              label: "VIN",
              width: null,
              align: "center"
            },
            {
              prop: "carLicenseNo",
              label: "车牌号",
              width: null,
              align: "center"
            },
            {
              prop: "carSeriesName",
              label: "车系",
              width: null,
              align: "center"
            },
            {
              prop: "carTypeName",
              label: "车型",
              width: null,
              align: "center"
            },
            {
              prop: "relationTypeName",
              label: "关系",
              width: null,
              align: "center"
            },
            {
              prop: "saleDate",
              label: "购车时间",
              width: null,
              align: "center"
            },
            {
              prop: "bindDate",
              label: "绑定时间",
              width: null,
              align: "center"
            }
          ]
        },
        // 订单记录  5  缺api
        {
          // title: "订单记录",
          // apiConfig: crmApis.custViewCustSaleOrderQueryFindAll, //客户信息明细-订单记录
          // formField: {
          //   dlrCustNo:this.$route.params.dlrCustNo},
          // tableCols: [
          //   {
          //     prop: "saleTypeId",
          //     label: "订单类型",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "saleOrderCode",
          //     label: "订单编号",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "carTypeCode",
          //     label: "车型编码",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "carTypeCn",
          //     label: "车型名称",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "invoicePrice",
          //     label: "订单金额",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "createdDate",
          //     label: "订单时间",
          //     width: null,
          //     align: "center"
          //   },
          //   // {
          //   //   prop: "",//que
          //   //   label: "备注",
          //   //   width: null,
          //   //   align: "center"
          //   // }
          // ]
        },
        // 获客渠道  6
        {
          title: "获客渠道",
          tableComponents: [
            {
              compKey: "compKey30",
              labelName: "线索渠道",
              codeField: "cantactWayName",
              isMust: true,
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey31",
              labelName: "一级信息来源",
              codeField: "infoChanMName",
              isMust: true,
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey32",
              labelName: "二级信息来源",
              codeField: "infoChanDName",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            }
          ]
        },
        // 客户画像  7
        {
          title: "客户画像",
          tableComponents: [
            {
              compKey: "compKey33",
              labelName: "学历",
              codeField: "degreeName",
              isMust: true,
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey34",
              labelName: "行业",
              codeField: "tradeCode",
              isMul: false,
              disabled: true,
              lookuptype: "VE0480",
              component: () =>import("@/components/crm/lookupValue/lookupvalue")
            },
            {
              compKey: "compKey35",
              labelName: "公司全称",
              codeField: "compName", //que
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey36",
              labelName: "职业",
              codeField: "jobCode",
              isMust: true,
              isMul: false,
              disabled: true,
              lookuptype: "VE0505",
              component: () => import("@/components/crm/lookupValue/lookupvalue")
            },
            {
              compKey: "compKey37",
              labelName: "婚姻状况",
              codeField: "marriagedName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey38",
              labelName: "是否有子女",
              codeField: "isHaveChildName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey39",
              labelName: "家庭年收入",
              codeField: "familyIncomeName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey40",
              labelName: "已有车型",
              codeField: "holdCarTypeName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey41",
              labelName: "车辆拥有时间",
              codeField: "holdCarTimeName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey42",
              labelName: "是否有驾驶证",
              codeField: "haveDriverCredName",
              disabled: true,
              isMust: true,
              component: () =>
                import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey43",
              labelName: "驾照类型",
              codeField: "driverTypeName",
              disabled: true,
              isMust: true,
              component: () =>
                import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey44",
              labelName: "驾龄",
              codeField: "driverTimeName",
              disabled: true,
              isMust: true,
              component: () =>
                import("@/components/crm/textbox/crmTextInput")
            },
            // {
            //   compKey: "compKey45",
            //   labelName: "是否网点VIP",
            //   codeField: "isVipName",
            //   disabled: true,
            //   isMust: true,
            //   component: () =>
            //     import("@/components/crm/textbox/crmTextInput")
            // },
            // {
            //   compKey: "compKey46",
            //   labelName: "VIP等级",
            //   codeField: "vipLevelName",
            //   disabled: true,
            //   isMust: true,
            //   component: () =>
            //     import("@/components/crm/textbox/crmTextInput")
            // },
            {
              compKey: "compKey47",
              labelName: "付款方式",
              codeField: "buyTypeName",
              disabled: true,
              isMust: true,
              component: () =>
                import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey48",
              labelName: "意向车型", //只读
              codeField: "inteCarTypeName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey49",
              labelName: "意向价格",
              codeField: "buyBudgetName",
              disabled: true,
              isMust: true,
              component: () =>
                import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey50",
              labelName: "意向外观颜色",
              codeField: "carColorName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey51",
              labelName: "意向内饰色",
              codeField: "carIncolorName",
              disabled: true,
              isMust: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              compKey: "compKey53",
              labelName: "上牌指标",
              codeField: "isHaveCarnumName",
              disabled: true,
              isMust: true,
              component: () =>
                import("@/components/crm/textbox/crmTextInput")
            }
          ]
        },
        //  8
        {
          tableComponents: [
            {
              compKey: "compKey54",
              labelName: "客户标签",
              codeField: "custTag",
              component: () => import("@/components/crm/textbox/crmTextInput")
            }
          ]
        },
        // 9
        {
          tableComponents: [
            {
              span: 12,
              compKey: "compKey52",
              labelName: "关注点",
              interest: "custFocus",
              codeField: "custFocus",
              isMul: false,
              component: () => import("@/components/crm/textbox/crmTextInput")
            },
            {
              span: 12,
              compKey: "compKey55",
              labelName: "兴趣爱好",
              interest: "hobby",
              codeField: "hobby",
              disabled: true,
              component: () => import("@/components/crm/textbox/crmTextInput")
            }
          ]
        },
        // 预约记录  9
        {
          // title: "预约记录",
          // apiConfig: crmApis.custViewCustBookingRecordQueryFindAll,
          // formField: {
          //   dlrCustNo: this.$route.params.dlrCustNo
          // },
          // tableCols: [
          //   {
          //     prop: "reserveOrderCode",
          //     label: "预约单号",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "reserveSource",
          //     label: "预约来源",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "createdDate",
          //     label: "预约时间",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "dlrShortName",
          //     label: "预约网点",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "reserveStateName",
          //     label: "预约状态",
          //     width: null,
          //     align: "center"
          //   },
          //   {
          //     prop: "factComeDate",
          //     label: "回厂时间",
          //     width: null,
          //     align: "center"
          //   }
          // ]
        },
        // 客户忠诚度  10
        {
          // title: "客户忠诚度",
          // tableComponents: [
          //   {
          //     compKey: "compKey56",
          //     labelName: "购车台次",
          //     codeField: "buyCarNum",
          //     isMust: true,
          //     disabled: true,
          //     component: () => import("@/components/crm/textbox/crmTextInput")
          //   },
          //   {
          //     compKey: "compKey57",
          //     labelName: "订单金额",
          //     codeField: "saleOrderMoney",
          //     isMust: true,
          //     disabled: true,
          //     component: () => import("@/components/crm/textbox/crmTextInput")
          //   },
          //   {
          //     compKey: "compKey58",
          //     labelName: "精品销售",
          //     codeField: "accSaleMoney",
          //     disabled: true,
          //     isMust: true,
          //     component: () => import("@/components/crm/textbox/crmTextInput")
          //   },
          //    {
          //     compKey: "compKey62",
          //     labelName: "备件销售",
          //     codeField: "partSaleMoney",
          //     disabled: true,
          //     isMust: true,
          //     component: () => import("@/components/crm/textbox/crmTextInput")
          //   }
          // ]
        },
        // 11
        {
          // tableComponents: [
          //   {
          //     compKey: "compKey59",
          //     labelName: "累计回厂台次",
          //     codeField: "totalBackNum",
          //     disabled: true,
          //     isMust: true,
          //     component: () => import("@/components/crm/textbox/crmTextInput")
          //   },
          //   {
          //     compKey: "compKey60",
          //     labelName: "半年回厂台次",
          //     codeField: "halfYearBackNum",
          //     disabled: true,
          //     isMust: true,
          //     component: () => import("@/components/crm/textbox/crmTextInput")
          //   },
          //   {
          //     compKey: "compKey61",
          //     labelName: "回厂消费金额",
          //     codeField: "backMoney",
          //     disabled: true,
          //     isMust: true,
          //     component: () => import("@/components/crm/textbox/crmTextInput")
          //   }

          // ]
        },
        {},
        // 客户出触点记录  12
        // {
        //   title: "客户触点记录",
        //   apiConfig: crmApis.custViewTouchQueryFindAll, //客户信息明细-客户触点记录
        //   formField: {dlrCustNo:this.$route.params.dlrCustNo},
        //   tableCols: [
        //     {
        //       prop: "serverTypeName",
        //       label: "工单类型",
        //       width: null,
        //       align: "center"
        //     },
        //     {
        //       prop: "serverTime",
        //       label: "服务请求时间",
        //       width: null,
        //       align: "center"
        //     },
        //     {
        //       prop: "serverOrder",
        //       label: "单号",
        //       width: null,
        //       align: "center"
        //     },
        //     {
        //       prop: "sourceSys",
        //       label: "来源系统",
        //       width: null,
        //       align: "center"
        //     },
        //     {
        //       prop: "contents",
        //       label: "内容",
        //       width: null,
        //       align: "center"
        //     },
        //     {
        //       prop: "status",
        //       label: "状态",
        //       width: null,
        //       align: "center"
        //     },
        //     {
        //       prop: "remark",
        //       label: "备注",
        //       width: null,
        //       align: "center"
        //     }
        //   ]
        // },
        // 客户资料修改日志  13
        {
          title: "客户资料修改日志",
          apiConfig: crmApis.custViewCustChangeLogQueryFindAll, //客户资料修改日志
          formField: {dlrCustNo:this.$route.params.dlrCustNo},
          tableCols: [
            {
              prop: "createdDate",
              label: "时间",
              width: null,
              align: "center"
            },
            {
              prop: "changeType",
              label: "变更类型",
              width: null,
              align: "center"
            },
            {
              prop: "changeContent",
              label: "变更内容",
              width: null,
              align: "center"
            },
            {
              prop: "sourceSys",
              label: "来源系统",
              width: null,
              align: "center"
            }
          ]
        }
      ],
      isdisplay: {
        ismuti: false
      },
      credit: false,
      // 保存API配置对象
      formSubmitButton: [],
      // 标题
      textMap: {
        edit: "个人客户视图",
        add: "个人客户视图"
      },
      formField: {
        uid: "",
        custName: "",
        custFullName: "",
        genderCode: "",
        genderName:'',
        birthDate: "",
        provinceId: "",
        cityId: "",
        countyId: "",
        nationCode: "",

        idCardPath:"",
        driveCardPath:"",
        drivingCardPath:"",
        // jobCode: "",
        custOriginCode: "",
        custSourceName: "",
        infoChanName:"",
        createdDate: "",
        bankCardNo: "",
        bankCode: "",
        credTypeCode: "",
        credNo: "",
        addrStreet: "",
        phone: "",
        backupPhone: "",
        homeTel: "",
        officeTel: "",
        qq: "",
        openId: "",
        email: "",
        convTimeCode: "",
        contactTypeCode: "",
        familyIncomeCode: "",
        convLocaleName: "",
        compName:"",

        cantactWayName: "",
        infoChanMName: "",
        infoChanDName: "",
        familyIncomeName: "",
        degreeName: "",

        // 客户忠诚度
        buyCarNum: "",
        saleOrderNum: "",
        saleOrderMoney: "",
        accSaleMoney: "",
        totalBackNum: "",
        halfYearBackNum: "",
        backMoney: "",
        partSaleMoney: "",

        tradeName: "",
        jobName: "", //职业
        jobCode:"",
        driverTimeName: "", //驾龄
        marriagedName: "",
        isVipName: "",
        vipLevelName: "",
        isHaveChildName: "",
        isHaveCarnumName: "", //上牌指标
        holdCarTypeName: "",
        holdCarTimeName: "",
        carSeriesCn: "", //职务
        hobby: "",
        custFocus: "",
        custTag: "",
        isVip: "",
        // focuseNameList: "",
        // custPropertyName: "",
        marriagedCode: "",
        isHaveChild: "",
        custNo: "",
        dlrCustNo: "",
        convLocaleCode: "", //最佳联系场所
        tradeCode: "",
        // interestsNameList: "",

        haveDriverCred:"",
        haveDriverCredName:"",
        driverTypeCode:"",
        driverTypeName:"",
        inteCarTypeCode:"",
        inteCarTypeName:"",
        buyBudget:"",
        buyBudgetName:"",
        intentCarColor:"",
        carColorName:"",
        intentCarInnerColor:"",
        carIncolorName:"",
        buyTypeCode:"",
        buyTypeName:"",

        invAccount:"",
        invBankName:"",
        addrZip:"",
        convLocaleName:"",
        credTypeName:"",
        addrProvince:"",
        addrCity:"",
        addrCounty:"",
        genderName:"",
        convTimeName:"",
        contactTypeName:"",
        nationCodeName:""
      }
    };
  },
  mounted() {
    this.$nextTick(() => {
      this.initdata();
    });
  },
  methods: {
    // 查询
    query(api, row, params,num) {
      let that = this;
      let queryObj = {
        type: "query",
        apiConfig: api,
        apiServices: [
          {
            apiQueryRow: row
          }
        ],
        variables: {
          dataInfo: params
        }
      };
      var paramD = that.$getParams(queryObj);
      requestAPI(paramD).then(response => {
        if (response.data[queryObj.apiConfig.ServiceCode].result == "1") {
          let results = response.data[queryObj.apiConfig.ServiceCode].rows[0];
          console.log(api,'apiapipaipai111111111');
              if(api.ServiceCode==='custViewCustBaseInfoQueryFindAll'){
                console.log(results,"resultsresults");

              }
          for (let key in this.formField) {
            if (results.hasOwnProperty(key)) {
              console.log(1111111111);

              this.formField[key] = results[key];
              if(api.ServiceCode==='custViewCustBaseInfoQueryFindAll'){
                console.log(key,"++++++++++++++",this.formField[key]);

              }
            }

            if(key==='birthDate' && results.hasOwnProperty(key)){
              this.formField[key] = results[key]+" 00:00:00"
            }
          }
          let list1 = [];
          let list2 = [];
          let list3 = [];
          list1[0] = {};
          list2[0] = {};
          list3[0] = {};
          if (num == 1) {
            debugger
            if(results.idCardPath&&results.idCardPath!="null")
            {
              list1[0].name = results.idCardPath.split("/")[
                results.idCardPath.split("/").length - 1
              ];
              list1[0].url = results.idCardPath;
              that.infoComponents[1].tableComponents[0].getVal = list1;
            }
            if(results.driveCardPath&&results.driveCardPath!="null"){
              list2[0].name = results.driveCardPath.split("/")[
                results.driveCardPath.split("/").length - 1
              ];
              list2[0].url = results.driveCardPath;
              that.infoComponents[1].tableComponents[1].getVal = list2;
            }
            if(results.drivingCardPath&&results.drivingCardPath!="null"){
              list3[0].name = results.drivingCardPath.split("/")[
                results.drivingCardPath.split("/").length - 1
              ];
              list3[0].url = results.drivingCardPath;
              that.infoComponents[1].tableComponents[2].getVal = list3;
            }
          }
        } else {
          that.$crmcf.showMessages(
            that,
            "error",
            response.data[queryObj.apiConfig.ServiceCode].msg
          );
        }
      });
    },
    initdata() {
      console.log(this.$route.params,'1111111');

      let params = {};
      // params.custNo = this.$route.params.custNo;
      params.dlrCustNo = this.$route.params.dlrCustNo;
      // 基本信息
      let formField1 = [
        "uid",
        "custName",
        // "custFullName",
        "genderCode",
        "genderName",
        "birthDate",
        "provinceId",
        "cityId",
        "countyId",
        "nationCode",
        "nationCodeName",
        "custOriginCode",
        "custSourceName",
        "infoChanName",
        "credTypeCode",
        "credNo",
        "addrStreet",
        "addrProvince",
        "addrCity",
        "addrCounty",
        "createdDate",
        "nationCodeName",
        "credTypeName",
        "idCardPath",
        "driveCardPath",
        "drivingCardPath"
      ];
      this.query(crmApis.custViewCustBaseInfoQueryFindAll, formField1, params,1);
      // 联系信息
      let formField2 = [
        "phone",
        "backupPhone",
        "homeTel",
        "officeTel",
        "qq",
        "openId",
        "email",
        "convTimeCode",
        "convTimeName",
        "contactTypeCode",
        "contactTypeName",
        "invAccount",
        "invBankName",
        "addrZip",
        "convLocaleName"
      ];
      this.query(crmApis.custViewContactWayQueryFindAll, formField2, params);
      // 客户画像&获客渠道
      let formField3 = [
        "cantactWayName",
        "infoChanMName",
        "infoChanDName",
        "familyIncomeName",
        "degreeName",
        "compName",//公司全称
        "tradeCode", //行业
        "jobName", //职务
        "jobCode",
        "driverTimeName", //驾龄
        "marriagedName",
        "isVipName",
        "vipLevelName",
        "isHaveChildName",
        "isHaveCarnumName", //上牌指标
        "holdCarTypeName",
        "holdCarTimeName",
        "carSeriesCn",
        "hobby",
        "custFocus",
        "custTag",
        "haveDriverCred",
        "haveDriverCredName",
        "driverTypeCode",
        "driverTypeName",
        "inteCarTypeCode",
        "inteCarTypeName",
        "buyBudget",
        "buyBudgetName",
        "intentCarColor",
        "carColorName",
        "intentCarInnerColor",
        "carIncolorName",
        "buyTypeCode",
        "buyTypeName",
      ];
      this.query(
        crmApis.custViewCustChannelImageQueryFindAll,
        formField3,
        params
      );
      // 客户忠诚度
      let formField4 = [
        "buyCarNum",
        "saleOrderNum",
        "saleOrderMoney",
        "accSaleMoney",
        "totalBackNum",
        "halfYearBackNum",
        "backMoney",
        "partSaleMoney"
      ];
      this.query(crmApis.custViewCustLevelQueryFindAll, formField4, params);
    }
  }
};
</script>
<style scoped>
.choosefile {
  float: left;
  text-align: left;
}
#carrelation,#orderrecord,#getcustWay,#custloyal,#custdatalog{
  border-top:1px solid #ddd
}
</style>
